/***********************************************************************
 * Module:  HistoriqueSinistre.java
 * Author:  a.kanwar
 * Purpose: Defines the Class HistoriqueSinistre
 ***********************************************************************/

import java.util.*;


public class HistoriqueSinistre {
   
   /********************************************************************
    * Attribute
    ********************************************************************/ 
    
    
   private int idHisSinistre;
   private java.util.Date dateSinistre;
   private java.lang.String libelle;
   private java.lang.String lieu;
   private float montant;
   private java.util.Collection<HistoriqueAssure> historiqueAssure;

   
   /**************************************************************************
    * Constructor
    **************************************************************************/
   
   
    public HistoriqueSinistre(int idHisSinistre, Date dateSinistre, String libelle, String lieu, float montant, Collection<HistoriqueAssure> historiqueAssure) {
        this.idHisSinistre = idHisSinistre;
        this.dateSinistre = dateSinistre;
        this.libelle = libelle;
        this.lieu = lieu;
        this.montant = montant;
        this.historiqueAssure = historiqueAssure;
    }

    public HistoriqueSinistre(Date dateSinistre, String libelle, String lieu, float montant, Collection<HistoriqueAssure> historiqueAssure) {
        this.dateSinistre = dateSinistre;
        this.libelle = libelle;
        this.lieu = lieu;
        this.montant = montant;
        this.historiqueAssure = historiqueAssure;
    }

    
     /**************************************************************************
    * getter and setter
    **************************************************************************/
    
    public int getIdHisSinistre() {
        return idHisSinistre;
    }

    public void setIdHisSinistre(int idHisSinistre) {
        this.idHisSinistre = idHisSinistre;
    }

    public Date getDateSinistre() {
        return dateSinistre;
    }

    public void setDateSinistre(Date dateSinistre) {
        this.dateSinistre = dateSinistre;
    }

    public String getLibelle() {
        return libelle;
    }

    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }

    public String getLieu() {
        return lieu;
    }

    public void setLieu(String lieu) {
        this.lieu = lieu;
    }

    public float getMontant() {
        return montant;
    }

    public void setMontant(float montant) {
        this.montant = montant;
    }

    @Override
    public String toString() {
        return "HistoriqueSinistre{" + "idHisSinistre=" + idHisSinistre + ", dateSinistre=" + dateSinistre + ", libelle=" + libelle + ", lieu=" + lieu + ", montant=" + montant + ", historiqueAssure=" + historiqueAssure + '}';
    }
   
   
   
   
   
   /******************************************************************
    * generate code by power AMC
    *******************************************************************/
   
   /** @pdGenerated default getter */
   public java.util.Collection<HistoriqueAssure> getHistoriqueAssure() {
      if (historiqueAssure == null)
         historiqueAssure = new java.util.HashSet<HistoriqueAssure>();
      return historiqueAssure;
   }
   
   /** @pdGenerated default iterator getter */
   public java.util.Iterator getIteratorHistoriqueAssure() {
      if (historiqueAssure == null)
         historiqueAssure = new java.util.HashSet<HistoriqueAssure>();
      return historiqueAssure.iterator();
   }
   
   /** @pdGenerated default setter
     * @param newHistoriqueAssure */
   public void setHistoriqueAssure(java.util.Collection<HistoriqueAssure> newHistoriqueAssure) {
      removeAllHistoriqueAssure();
      for (java.util.Iterator iter = newHistoriqueAssure.iterator(); iter.hasNext();)
         addHistoriqueAssure((HistoriqueAssure)iter.next());
   }
   
   /** @pdGenerated default add
     * @param newHistoriqueAssure */
   public void addHistoriqueAssure(HistoriqueAssure newHistoriqueAssure) {
      if (newHistoriqueAssure == null)
         return;
      if (this.historiqueAssure == null)
         this.historiqueAssure = new java.util.HashSet<HistoriqueAssure>();
      if (!this.historiqueAssure.contains(newHistoriqueAssure))
      {
         this.historiqueAssure.add(newHistoriqueAssure);
         newHistoriqueAssure.setHistoriqueSinistre(this);      
      }
   }
   
   /** @pdGenerated default remove
     * @param oldHistoriqueAssure */
   public void removeHistoriqueAssure(HistoriqueAssure oldHistoriqueAssure) {
      if (oldHistoriqueAssure == null)
         return;
      if (this.historiqueAssure != null)
         if (this.historiqueAssure.contains(oldHistoriqueAssure))
         {
            this.historiqueAssure.remove(oldHistoriqueAssure);
            oldHistoriqueAssure.setHistoriqueSinistre((HistoriqueSinistre)null);
         }
   }
   
   /** @pdGenerated default removeAll */
   public void removeAllHistoriqueAssure() {
      if (historiqueAssure != null)
      {
         HistoriqueAssure oldHistoriqueAssure;
         for (java.util.Iterator iter = getIteratorHistoriqueAssure(); iter.hasNext();)
         {
            oldHistoriqueAssure = (HistoriqueAssure)iter.next();
            iter.remove();
            oldHistoriqueAssure.setHistoriqueSinistre((HistoriqueSinistre)null);
         }
      }
   }

}